<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="author" content="Yb">
    <title>下拉菜单</title>
    <script src="../js/jquery-3.1.1.js"></script>
    <style type="text/css">
        * {
            box-sizing: border-box;
        }
        
        body,
        ul,
        li {
            margin: 0;
            padding: 0;
        }
        
        ul {
            list-style: none;
            text-align: center;
        }
        
        .container {
            height: 50px;
            background-color: #eee;
        }
        
        .container nav {
            width: 600px;
            margin: 0 auto;
            background-color: #aaa;
        }
        
        .container li.dropdown-menu {
            float: left;
            width: 25%;
            height: 50px;
            line-height: 50px;
            padding: 0 25px;
            position: relative;
        }
        
        .container li.dropdown-menu a {
            display: block;
            text-decoration: none;
            color: #eee;
            /*background-color: red;*/
        }
        
        .container li.dropdown-menu a:hover {
            text-decoration: underline;
            color: #f90;
        }
        
        .container li.dropdown-menu ul.dropdown-content {
            width: 100px;
            border: 1px solid #ccc;
            border-top: none;
            position: absolute;
            top: 50px;
            left: 25px;
            color: #aaa;
            display: none;
        }
        
        .container li.dropdown-menu ul.dropdown-content li:hover {
            cursor: pointer;
            text-decoration: underline;
        }
    </style>
</head>

<body>
    <div class="container">
        <nav>
            <ul class="dropdown">
                <li class="dropdown-menu">
                    <a href="javascript:;">公司简介</a>
                    <ul class="dropdown-content">
                        <li>概况介绍</li>
                        <li>发展历史</li>
                        <li>公司实力</li>
                    </ul>
                </li>
                <li class="dropdown-menu">
                    <a href="javascript:;">产品介绍</a>
                    <ul class="dropdown-content">
                        <li>软件研发</li>
                        <li>软件教育</li>
                        <li>天使投资</li>
                    </ul>
                </li>
                <li class="dropdown-menu">
                    <a href="javascript:;">联系我们</a>
                    <ul class="dropdown-content">
                        <li>公司地址</li>
                        <li>联系方式</li>
                        <li>投资加盟</li>
                    </ul>
                </li>
                <li class="dropdown-menu">
                    <a href="javascript:;">人才招聘</a>
                    <ul class="dropdown-content">
                        <li>iOS招聘</li>
                        <li>HTML5招聘</li>
                        <li>PHP招聘</li>
                    </ul>
                </li>
                <div style="clear: both;"></div>
            </ul>
        </nav>
    </div>
</body>

</html>
<script>
    $(function () {
        $('div.container li.dropdown-menu').each(function (index) {
            $(this).mouseover(function () {
                $('div.container ul.dropdown-content')
                    // 隐藏所有的
                    .hide()
                    // 根据索引值显示当的
                    .eq($(this).index()).show();
            });

            $(this).mouseleave(function () {
                $('div.container ul.dropdown-content').hide();
            });
        });
    });
</script>